import 'package:flutter_test/flutter_test.dart';
import 'package:player_plugin/player_plugin.dart';
import 'package:player_plugin/player_plugin_platform_interface.dart';
import 'package:player_plugin/player_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPlayerPluginPlatform
    with MockPlatformInterfaceMixin
    implements PlayerPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final PlayerPluginPlatform initialPlatform = PlayerPluginPlatform.instance;

  test('$MethodChannelPlayerPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelPlayerPlugin>());
  });

  test('getPlatformVersion', () async {
    PlayerPlugin playerPlugin = PlayerPlugin();
    MockPlayerPluginPlatform fakePlatform = MockPlayerPluginPlatform();
    PlayerPluginPlatform.instance = fakePlatform;

    expect(await playerPlugin.getPlatformVersion(), '42');
  });
}
